<template>
	<view class="chart-wrapper">
		<view class="chart-title">6小时趋势</view>
		<view style="background-color: #5398e2; z-index: 1; position: relative;">
			<qiun-data-charts type="line" :opts="opts" :chartData="chartData" canvasId="sixHourChart" />
		</view>
	</view>
</template>

<script>
	export default {
		name: 'SixHourTrendChart',
		props: {
			chartData: {
				type: Object,
				required: true
			}
		},
		data() {
			return {
				opts: {
					color: ['#3c9cff'],
					padding: [10, 10, 10, 10],
					enableScroll: false,
					legend: false,
					xAxis: {
						disableGrid: true,
						labelCount: 6,
						fontColor: '#ffffff'
					},
					yAxis: {
						min: 0,
						max: 30,
						splitNumber: 4,
						gridType: 'dash',
						dashLength: 4,
						fontColor: '#ffffff'
					},
					background: '#00000000',
					extra: {
						line: {
							type: 'curve',
							width: 2,
							activeType: 'none',
							linearType: 'custom',
							onShade: true
						},
						area: {
							gradient: true
						}
					}
				}
			};
		}
	};
</script>

<style scoped>
	.chart-wrapper {
		/* background: linear-gradient(to bottom right, #9dd6fc, #cce7ff); */
		background-color: #65abe6;
		border-radius: 12rpx;
		padding: 24rpx;
	}

	.chart-title {
		font-size: 40rpx;
		color: #ffffff;
		font-weight: bold;
		margin-bottom: 10px;
	}

	.chart-subtitle {
		font-size: 22rpx;
		color: #e0f0ff;
		margin-bottom: 16rpx;
	}
</style>